<template>
  <div>
     购物车商品总价：
    <!-- 商品是否大于500 符合条件可使用400的优惠券 否则不可使用 -->
    {{ total * price >= 500 ? total * price - coupon : total * price }}
    {{num}}
  </div>
</template>

<script>
export default {
  name: 'VueliDemoApp',

  data() {
    return {
      total:9,
      price:88,
      coupon:500,
      
    };
  },

  mounted() {
    
  },

  methods: {
    totalPrice(){
       return this.total * this.price >= 500 ? this.total * this.price - this.coupon : this.total * this.price
    }
    
  },
  computed:{
    num(){
       return this.total * this.price >= 500 ? this.total * this.price - this.coupon : this.total * this.price
    }
  }
};
</script>

<style lang="scss" scoped>

</style>